/*
 * Copyright (c) 2019.  鼎捷软件股份有限公司.All rights reserved.
 */

package com.digiwin.dap.middleware.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * *
 */
@MappedSuperclass
public abstract class BaseEntity implements Serializable {
    /**
     * 主键
     */
    @Id
    @GenericGenerator(name = "sid", strategy = "assigned")
    private long sid;


    public long getSid() {
        return sid;
    }

    public void setSid(long sid) {
        this.sid = sid;
    }

    /**
     * s
     * 创建人
     */
    @Column(name = "create_by", columnDefinition = "bigint(20) DEFAULT 0")
    private Long createBy;
    /**
     * 创建人
     */
    @Column(name = "create_provider", columnDefinition = "bigint(20) DEFAULT 0")
    private Long createProvider;
    /**
     * 创建组织
     */
    @Column(name = "create_org", columnDefinition = "bigint(20) DEFAULT 0")
    private Long createOrg;
    @Column(name = "create_date", columnDefinition = "DATE")
    private LocalDateTime createDate;
    @Column(name = "modify_by", columnDefinition = "bigint(20) DEFAULT 0")
    private Long modifyBy;
    @Column(name = "modify_provider", columnDefinition = "bigint(20) DEFAULT 0")
    private Long modifyProvider;
    @Column(name = "modify_date", columnDefinition = "DATE")
    private LocalDateTime modifyDate;
    /**
     * 做乐观锁，修改时hash值必须一致
     */
    @Column(name = "hash", length = 40)
    private String hash;
    /**
     * 是否被禁用
     */
    @Column(name = "disabled", columnDefinition = "bit(1) DEFAULT 0")
    private boolean disabled;
    /**
     * 是否被删除
     */
    @Column(name = "deleted", columnDefinition = "bit(1) DEFAULT 0")
    private boolean deleted;

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getCreateProvider() {
        return createProvider;
    }

    public void setCreateProvider(Long createProvider) {
        this.createProvider = createProvider;
    }

    public Long getCreateOrg() {
        return createOrg;
    }

    public void setCreateOrg(Long createOrg) {
        this.createOrg = createOrg;
    }

    public LocalDateTime getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDateTime createDate) {
        this.createDate = createDate;
    }

    public Long getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(Long modifyBy) {
        this.modifyBy = modifyBy;
    }

    public Long getModifyProvider() {
        return modifyProvider;
    }

    public void setModifyProvider(Long modifyProvider) {
        this.modifyProvider = modifyProvider;
    }

    public LocalDateTime getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(LocalDateTime modifyDate) {
        this.modifyDate = modifyDate;
    }

    public String getHash() {
        return hash;
    }

    public void setHash(String hash) {
        this.hash = hash;
    }

    public boolean isDisabled() {
        return disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }
}
